package com.gzh.teaching.model.vo;

import com.gzh.core.model.vo.BasePageParam;
import com.gzh.core.util.NumericHelper;
import com.gzh.teaching.service.dto.CommentIn;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Setter
@Getter
@ToString
public class CommentParam extends BasePageParam {

  private String commentId;
  private String superCommentId;
  private String content;
  private String topicId;
  private String likeId;
  private String courseId;
  private String isLike;

  public CommentIn paramToIn(Integer userId) {

    CommentIn in = new CommentIn();
    in.setCommentId(NumericHelper.toInteger(this.commentId));
    in.setSuperCommentId(NumericHelper.toInteger(this.superCommentId));
    in.setTopicId(NumericHelper.toInteger(this.topicId));
    in.setLikeId(NumericHelper.toInteger(this.likeId));
    in.setCourseId(NumericHelper.toInteger(this.courseId));
    in.setIsLike(NumericHelper.toInteger(this.isLike));
    in.setContent(this.content);
    in.setUserId(userId);
    in.setPageNum(this.getPageNum());
    in.setPageSize(this.getPageSize());
    return in;
  }
}
